<!DOCTYPE html>
<html>
  <head>
    <script src="../../../../../processing.js"></script>
    <link rel="stylesheet" href="../../../../style.css" />
  </head> 

  <body> 
    <h1><a href="http://asalga.wordpress.com">Andor Salga</a></h1>
    <h2>Spiral Demo</h2>

    <p>
      <canvas datasrc="spiral.pjs" style="width:200;height:200;"></canvas>
    </p>
    
    <pre>
<b>// Test by Andor Salga</b>
import processing.opengl.*;

float r = 0;

void setup(){
  size(200,200,OPENGL);
}

void draw(){
  background(0);
  
  translate(width/2, height/2, 0);
  pushMatrix();
  rotateZ(r+=0.05);
  
  float f=50;

  for(int i=0; i < 100; i++, f-= 0.5){
    strokeWeight(i/8);
    stroke(200,100,50, 250-i);
    point(sin(i)* f * 2, cos(i)*f*2, 0);
  }
  popMatrix();

  pushMatrix();
  rotateZ(-r);
  f=50;

  for(int i=0; i < 100; i++, f-= 0.5){
    strokeWeight(i/8);
    stroke(50,100,200, 250-i);
    point(cos(i)*f*2, sin(i)* f * 2, 0);
  }
  popMatrix();
}</pre>

  </body>
</html>
